package com.ctsi.ssdc.admin.domain;

import com.ctsi.ssdc.criteria.IntegerCriteria;
import com.ctsi.ssdc.criteria.StringCriteria;
import com.ctsi.ssdc.criteria.ZonedDateTimeCriteria;
import com.ctsi.ssdc.example.BaseExample;
import io.swagger.annotations.ApiParam;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;

/**
 * @author ctsi-biyi-generator
*/
public class CscpUserPasswordChangeLogExample extends BaseExample {
    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    protected String orderByClause;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    protected boolean distinct;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    protected List<Criteria> oredCriteria;

    /**
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private static final String LIKE_FORMAT = "%%%s%%";

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column cscp_user_password_change_log.id
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private IntegerCriteria id;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column cscp_user_password_change_log.user_id
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private IntegerCriteria userId;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column cscp_user_password_change_log.password
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private StringCriteria password;

    /**
     *
     * This field was generated by MyBatis Generator.
     * This field corresponds to the database column cscp_user_password_change_log.time
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private ZonedDateTimeCriteria time;

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public CscpUserPasswordChangeLogExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public String getOrderByClause() {
        return orderByClause;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public boolean isDistinct() {
        return distinct;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public IntegerCriteria getId() {
        return id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void setId(IntegerCriteria id) {
        this. id = id;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private void buildIdCriteria(Criteria criteria) {
        if (this.getId() == null) {
            return;
        }
        if (this.getId().getEquals() != null) {
            criteria.andIdEqualTo(this.getId().getEquals());
        } else {
            if (this.getId().getGreaterOrEqualThan() != null) {
                criteria.andIdGreaterThanOrEqualTo(this.getId().getGreaterOrEqualThan());
            }
            if (this.getId().getLessOrEqualThan() != null) {
                criteria.andIdLessThanOrEqualTo(this.getId().getLessOrEqualThan());
            }
        }
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public IntegerCriteria getUserId() {
        return userId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void setUserId(IntegerCriteria userId) {
        this. userId = userId;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private void buildUserIdCriteria(Criteria criteria) {
        if (this.getUserId() == null) {
            return;
        }
        if (this.getUserId().getEquals() != null) {
            criteria.andUserIdEqualTo(this.getUserId().getEquals());
        } else {
            if (this.getUserId().getGreaterOrEqualThan() != null) {
                criteria.andUserIdGreaterThanOrEqualTo(this.getUserId().getGreaterOrEqualThan());
            }
            if (this.getUserId().getLessOrEqualThan() != null) {
                criteria.andUserIdLessThanOrEqualTo(this.getUserId().getLessOrEqualThan());
            }
        }
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public StringCriteria getPassword() {
        return password;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void setPassword(StringCriteria password) {
        this. password = password;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private void buildPasswordCriteria(Criteria criteria) {
        if (this.getPassword() == null) {
            return;
        }
        if (this.getPassword().getEquals() != null) {
            criteria.andPasswordEqualTo(this.getPassword().getEquals());
        } else {
            if (StringUtils.isNotBlank(this.getPassword().getContains())) {
                criteria.andPasswordLike(String.format(LIKE_FORMAT, this.getPassword().getContains()));
            }
        }
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public ZonedDateTimeCriteria getTime() {
        return time;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public void setTime(ZonedDateTimeCriteria time) {
        this. time = time;
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    private void buildTimeCriteria(Criteria criteria) {
        if (this.getTime() == null) {
            return;
        }
        if (this.getTime().getEquals() != null) {
            criteria.andTimeEqualTo(this.getTime().getEquals());
        } else {
            if (this.getTime().getGreaterOrEqualThan() != null) {
                criteria.andTimeGreaterThanOrEqualTo(this.getTime().getGreaterOrEqualThan());
            }
            if (this.getTime().getLessOrEqualThan() != null) {
                criteria.andTimeLessThanOrEqualTo(this.getTime().getLessOrEqualThan());
            }
        }
    }

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public Object buildCriteria() {
        Criteria criteria = this.createCriteria();
        this.buildIdCriteria(criteria);
        this.buildUserIdCriteria(criteria);
        this.buildPasswordCriteria(criteria);
        this.buildTimeCriteria(criteria);
        return criteria;
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }

        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(Integer value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(Integer value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(Integer value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(Integer value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(Integer value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<Integer> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<Integer> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(Integer value1, Integer value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(Integer value1, Integer value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andUserIdIsNull() {
            addCriterion("user_id is null");
            return (Criteria) this;
        }

        public Criteria andUserIdIsNotNull() {
            addCriterion("user_id is not null");
            return (Criteria) this;
        }

        public Criteria andUserIdEqualTo(Integer value) {
            addCriterion("user_id =", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdNotEqualTo(Integer value) {
            addCriterion("user_id <>", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdGreaterThan(Integer value) {
            addCriterion("user_id >", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdGreaterThanOrEqualTo(Integer value) {
            addCriterion("user_id >=", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdLessThan(Integer value) {
            addCriterion("user_id <", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdLessThanOrEqualTo(Integer value) {
            addCriterion("user_id <=", value, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdIn(List<Integer> values) {
            addCriterion("user_id in", values, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdNotIn(List<Integer> values) {
            addCriterion("user_id not in", values, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdBetween(Integer value1, Integer value2) {
            addCriterion("user_id between", value1, value2, "userId");
            return (Criteria) this;
        }

        public Criteria andUserIdNotBetween(Integer value1, Integer value2) {
            addCriterion("user_id not between", value1, value2, "userId");
            return (Criteria) this;
        }

        public Criteria andPasswordIsNull() {
            addCriterion("password is null");
            return (Criteria) this;
        }

        public Criteria andPasswordIsNotNull() {
            addCriterion("password is not null");
            return (Criteria) this;
        }

        public Criteria andPasswordEqualTo(String value) {
            addCriterion("password =", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordNotEqualTo(String value) {
            addCriterion("password <>", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordGreaterThan(String value) {
            addCriterion("password >", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordGreaterThanOrEqualTo(String value) {
            addCriterion("password >=", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordLessThan(String value) {
            addCriterion("password <", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordLessThanOrEqualTo(String value) {
            addCriterion("password <=", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordLike(String value) {
            addCriterion("password like", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordNotLike(String value) {
            addCriterion("password not like", value, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordIn(List<String> values) {
            addCriterion("password in", values, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordNotIn(List<String> values) {
            addCriterion("password not in", values, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordBetween(String value1, String value2) {
            addCriterion("password between", value1, value2, "password");
            return (Criteria) this;
        }

        public Criteria andPasswordNotBetween(String value1, String value2) {
            addCriterion("password not between", value1, value2, "password");
            return (Criteria) this;
        }

        public Criteria andTimeIsNull() {
            addCriterion("time is null");
            return (Criteria) this;
        }

        public Criteria andTimeIsNotNull() {
            addCriterion("time is not null");
            return (Criteria) this;
        }

        public Criteria andTimeEqualTo(ZonedDateTime value) {
            addCriterion("time =", value, "time");
            return (Criteria) this;
        }

        public Criteria andTimeNotEqualTo(ZonedDateTime value) {
            addCriterion("time <>", value, "time");
            return (Criteria) this;
        }

        public Criteria andTimeGreaterThan(ZonedDateTime value) {
            addCriterion("time >", value, "time");
            return (Criteria) this;
        }

        public Criteria andTimeGreaterThanOrEqualTo(ZonedDateTime value) {
            addCriterion("time >=", value, "time");
            return (Criteria) this;
        }

        public Criteria andTimeLessThan(ZonedDateTime value) {
            addCriterion("time <", value, "time");
            return (Criteria) this;
        }

        public Criteria andTimeLessThanOrEqualTo(ZonedDateTime value) {
            addCriterion("time <=", value, "time");
            return (Criteria) this;
        }

        public Criteria andTimeIn(List<ZonedDateTime> values) {
            addCriterion("time in", values, "time");
            return (Criteria) this;
        }

        public Criteria andTimeNotIn(List<ZonedDateTime> values) {
            addCriterion("time not in", values, "time");
            return (Criteria) this;
        }

        public Criteria andTimeBetween(ZonedDateTime value1, ZonedDateTime value2) {
            addCriterion("time between", value1, value2, "time");
            return (Criteria) this;
        }

        public Criteria andTimeNotBetween(ZonedDateTime value1, ZonedDateTime value2) {
            addCriterion("time not between", value1, value2, "time");
            return (Criteria) this;
        }
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated do_not_delete_during_merge Mon Jan 06 10:20:10 CST 2020
     */
    public static class Criteria extends GeneratedCriteria {

        protected Criteria() {
            super();
        }
    }

    /**
     * This class was generated by MyBatis Generator.
     * This class corresponds to the database table cscp_user_password_change_log
     *
     * @mbg.generated Mon Jan 06 10:20:10 CST 2020
     */
    public static class Criterion {
        @ApiParam(hidden=true)
        private String condition;

        @ApiParam(hidden=true)
        private Object value;

        @ApiParam(hidden=true)
        private Object secondValue;

        @ApiParam(hidden=true)
        private boolean noValue;

        @ApiParam(hidden=true)
        private boolean singleValue;

        @ApiParam(hidden=true)
        private boolean betweenValue;

        @ApiParam(hidden=true)
        private boolean listValue;

        @ApiParam(hidden=true)
        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}